//
//  HWVideoshipingViewController.m
//  HWanGame
//
//  Created by 陈道斌 on 2020/9/9.
//  Copyright © 2020 Chendaobin. All rights reserved.
//

#import "HWVideoshipingViewController.h"
#import "CLTableViewViewController.h"
#import "HWFocusJiemianViewController.h"
#import "HWanGame-Swift.h"
@interface HWVideoshipingViewController ()<JXSegmentedListContainerViewListDelegate>
@property(strong,nonatomic)UIButton *recommendedBut;
@property(strong,nonatomic)UIButton *focuSBut;
@property(strong,nonatomic)CLTableViewViewController *tuijianController;
@property(strong,nonatomic)HWFocusJiemianViewController *focusJiemianController;


@end

@implementation HWVideoshipingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self setupUI];
    
    [self addAbuttonTapView];
    
}


- (UIView *)listView {
    return  self.view;
}


- (void)setupUI {
    
    self.view.backgroundColor = RGB(66, 66, 66);
    
    
    
    
    
    
    [self addchildeView];
    
    
    
    
    
    
    
    
}


// 添加按钮
- (void)addAbuttonTapView {
    
    
    // 131wan 推广助手
    
    self.recommendedBut = [UIButton buttonWithType:UIButtonTypeCustom];
    self.recommendedBut.frame = CGRectMake(kScreenW/2-40-10, CF_StatusBarHeight+5, 40, 30);
    self.recommendedBut.frame = CGRectMake(kScreenW/2-60-10, 5, 60, 30);
    [self.recommendedBut setTitleColor:RGB(255, 255, 255) forState:UIControlStateNormal];
   //  self.recommendedBut.backgroundColor = [UIColor redColor];
//    [self.recommendedBut setTitle:@"推荐" forState:UIControlStateNormal];
    
//    [self.recommendedBut setTitle:[HWjianzhiduiObject keylocalization:@"推荐"] forState:UIControlStateNormal];
    
    
    [self.recommendedBut addTarget:self action:@selector(tuijianTap) forControlEvents:UIControlEventTouchUpInside];

    [self.view addSubview:self.recommendedBut];
    
    
//    self.focuSBut = [UIButton buttonWithType:UIButtonTypeCustom];
//    self.focuSBut.frame = CGRectMake(kScreenW/2 +10, CF_StatusBarHeight+5, 40, 30);
//
//    self.focuSBut.frame = CGRectMake(kScreenW/2 +10, 5, 60, 30);
//    [self.focuSBut setTitleColor:RGB(136, 136, 136) forState:UIControlStateNormal];
//    [self.focuSBut setTitle:@"关注" forState:UIControlStateNormal];
    
//    [self.focuSBut setTitle:[HWjianzhiduiObject keylocalization:@"关注"] forState:UIControlStateNormal];
// //     self.focuSBut.backgroundColor = [UIColor redColor];
//     [self.focuSBut addTarget:self action:@selector(guanzhuTap) forControlEvents:UIControlEventTouchUpInside];
//     [self.view addSubview:self.focuSBut];
    
    
}






- (void)addchildeView {
    
    CLTableViewViewController  *jingxuang  = [CLTableViewViewController new];
    self.tuijianController = jingxuang;
    [self addChildViewController:jingxuang];
    jingxuang.view.frame = CGRectMake(0, 0, kScreenW, kScreenH);
    [self.view addSubview:jingxuang.view];

    self.tuijianController.view.hidden = NO;
}


- (void)viewWillAppear:(BOOL)animated {

      [super viewWillAppear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    
}


-(void)viewWillDisappear:(BOOL)animated {
    
    
    [super viewWillDisappear:animated];
    if (@available(iOS 13.0, *)) {
        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDarkContent;
    } else {
        [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
    }
    
}


//推荐
- (void)tuijianTap {
    
    
    
    [self.recommendedBut setTitleColor:RGB(255, 255, 255) forState:UIControlStateNormal];
    
       [self.focuSBut setTitleColor:RGB(136, 136, 136) forState:UIControlStateNormal];
    
    
    self.tuijianController.view.hidden = NO;
    
    [self.tuijianController shuxingshuju];
    
//    self.focusJiemianController.view.hidden = YES;
    
    
}

//关注

- (void)guanzhuTap {
    
        [self.recommendedBut setTitleColor:RGB(136, 136, 136) forState:UIControlStateNormal];
         [self.focuSBut setTitleColor:RGB(255, 255, 255) forState:UIControlStateNormal];
    
    
    self.tuijianController.view.hidden = YES;
//    self.focusJiemianController.view.hidden = NO;
    // 关闭推荐的播放
    [self.tuijianController closeplayView];
    [self.focusJiemianController shuxingshuju];
    
}


@end
